//
//  Defines.h
//
//  Created by ZhenYu.W on 15/8/20.
//  Copyright (c) 2015年 unshu.com. All rights reserved.
//
///存在缓存数据
#define Publication_CacheData_Directory [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/CacheData"]

#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define RGB(r,g,b)          [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1]

#define ThemeColor      [UIColor colorWithRed:247.0/255 green:110.0/255 blue:30.0/255 alpha:1]
#define FormalThemeColor      [UIColor colorWithRed:107.0/255 green:118.0/255 blue:223.0/255 alpha:1]
#define TextColor      [UIColor colorWithRed:45.0/255 green:45.0/255 blue:45.0/255 alpha:1]
#define TextGrayColor      [UIColor colorWithRed:150.0/255 green:150.0/255 blue:150.0/255 alpha:1]
#define LineColor      [UIColor colorWithRed:226.0/255.0 green:226.0/255.0 blue:226.0/255.0 alpha:1]
#define BackgroundColor      [UIColor colorWithRed:245.0/255.0 green:247.0/255.0 blue:250.0/255.0 alpha:1]
#define TextLightColor      [UIColor colorWithRed:95.0/255 green:95.0/255 blue:95.0/255 alpha:1]
#define BlueColor      [UIColor colorWithRed:29.0/255.0 green:139.0/255.0 blue:254.0/255.0 alpha:1]
#define PlaceholderColor RGBACOLOR(0, 0, 0.0980392, 0.22)

#define CITYNAME  @"CITYNAME"
#define APPLEID @"1255429329"
#define DEFAULTS        [NSUserDefaults standardUserDefaults]
#define SYSTEM_CONFIG               @"SYSTEM_CONFIG"
// 无需定义debug，debug是通过build schema来定义的，如果是distribution build，debug就是未定义
#ifdef DEBUG
#define DEBUG_NETWORK_TRAFIC YES
#define DEBUG_NETWORK_TRAFIC_RESPONSE YES
#define NSLog(...) NSLog(__VA_ARGS__)
#else
#define NSLog(...) do {} while (0)
#endif

#define SCREEN_WIDTH_DEVICE ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT_DEVICE ([UIScreen mainScreen].bounds.size.height)
#define SCREEN_SCALE (float)([UIScreen mainScreen].bounds.size.width/375.0)
#define SCREEN_SCALE_320 (float)([UIScreen mainScreen].bounds.size.width/320.0)

#define LOADINGINTO @"正在加载"
#define ISNONETWORK @"请检查网络连接"
#define ISBADNETWORK @"网络不佳"
#define ISSERVIECCRASH @"服务器正在维护"
#define TIMEOUTINFO @"请求超时，请重试"
#define USERID                      @"USERID"
#define KNOTIFICATION_LOGINCHANGE @"loginStateChange"
#define KNOTIFICATIONNAME_DELETEALLMESSAGE @"RemoveAllMessages"
#define IMPASSWORD                  @"qingjiaoshebao123123" //环信登录密码
#define SYSTEM_UNREADMESSAGE        @"SYSTEM_UNREADMESSAGE"
#define DEMO_CALL 1
#define KEFUPHONE @"15295619837" //客服电话
#define USERCODE @"20172706100"

#define HOSTSBIP @"http://test.shebaotong.com/"
#define ACCESSTOKEN @"d320883d748a6175ade4655505946b77"

//#define HOSTSBIP @"https://api.shebaotong.com/v1/"
//#define ACCESSTOKEN @"e384a6e446ef03ee008a2e6fb9089281"

#define HOSTURL @"http://www.bawangrong.com/"
#define HOSTIP @"http://www.bawangrong.com:8080/"
#define IMAGEIP @"http://www.bawangrong.com:8080/"
#define SHAREAPPURL @"http://www.bawangrong.com/formal1/index.html"

#define UMKEY @"597fea8e07fe654990000782"
#define JPUSHKEY @"2c7ca19f4a6da91eb40400a7"
#define SMSKEY @"1e06bc27634dd"
#define SMSSECRET @"7dc22d7fc014cb49e4caf4ea9b060274"

#define DefaultHeaderUIImage [UIImage imageNamed:@"wode_touxiang_pic"]

#define boundsWidth self.view.bounds.size.width
#define boundsHeight self.view.bounds.size.height

//判断设备为4寸屏幕
#define RETINA_4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define IOS8_OR_LATER   ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) ? (YES):(NO)
#define IOS11_OR_LATER   ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0) ? (YES):(NO)
//判断ios7
#define IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define IPHONE4 ([[[UIDeviceHardware share]deviceName]isEqualToString:@"iPhone 4"]
#define CLIENT_VERSION [[[NSBundle mainBundle] infoDictionary]objectForKey:@"CFBundleVersion"]
#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
#define IS_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define IS_iPhoneX_Top (float)(IS_iPhoneX ? (24):(0))
#define IS_iPhoneX_Bottom (float)(IS_iPhoneX ? (34):(0))
#define CURRENT_DEVICE_IS_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
#define CURRENT_DEVICE_IS_IPHONE UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone
//#endif

//设置十六进制颜色
#define DEF_UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

